#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPen>
#include <QTableWidget>
#include "qcustomplot.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    bool event(QEvent *mEvent);
    QTableWidget* table, *splineTable;
    void countFunc(QString function, double x0, double xn, int n,  QVector<double>& x,  QVector<double>& y, QVector<double>& yDiff, QVector<double>& ySecondDiff);
    void plotFunc(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));
    void plotFunc2(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));
    void createSpline (QVector<double>& x, QVector<double>& f, int n, double S0, double Sn);

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

private:
    Ui::MainWindow *ui;
    QCustomPlot* difference;
};

#endif // MAINWINDOW_H
